package com.example;

import java.util.Iterator;

import android.content.Context;

public class WebAppInterface {
	Context mContext;

	/**
	 * Instantiate the interface and set the context
	 * 
	 * @return
	 */
	WebAppInterface(Context c) {
		mContext = c;
	}

	/*
	 * public String getEventsListAsJSON() { Logger mylog = new Logger();
	 * //return mylog.readLargeEventTableAsJSON(); }
	 * 
	 * public String getMinorEventsListAsJSON() { Logger mylog = new Logger();
	 * //return mylog.readMinorEventTableAsJSON(); }
	 */

	public String join(Iterator<?> iterator, String separator) {
		String mystring = "";
		if (iterator.hasNext()) {
			mystring = (String) iterator.next();
		}
		if (iterator.hasNext()) {
			mystring += separator;
			mystring += (String) iterator.next();
		}
		return mystring;
	}

	/** Show a toast from the web page */
	/*
	 * public String returnProfilesAsJSON(String query) {
	 * 
	 * return getEventsListAsJSON(); }
	 */
}